from socket import *
from time import sleep

ADDR = ("127.0.0.1",8888)

data = [
  "张三  18   177",
  "李四  19   180",
  "王五  20   183"
]

sock = socket()
sock.connect(ADDR)  # 连接

# for row in data:
#     sock.send(row.encode())
#     sleep(0.1) # 增加发送延迟
# sock.send(b"#")

# 人为添加消息分割 \n
data = "\n".join(data)
sock.send(data.encode())


sock.close()

